package com.lagou.DAO.Impl;

import com.lagou.DAO.ArticleDao;
import com.lagou.domain.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;


@Repository
public class ArticleDaoImpl implements ArticleDao {

    //持久层采用JDBCTemplate
    @Autowired
    private JdbcTemplate jdbcTemplate;


    public void add(Article article) {
            String sql = " insert into t_article values (null, ?, ?) ";

            jdbcTemplate.update(sql, article.getTitle(), article.getContent());

    }
}
